<template>
  <div>user</div>
  <hr />
  <p class="links">
    <NuxtLink to="/">to index</NuxtLink>
    <NuxtLink to="/data/test">data test</NuxtLink>
  </p>
  <p>
    <button @click="show = !show">
      {{ show ? "隐藏val" : "显示val" }}
    </button>
  </p>
  <hr />
  <KeepAlive :include="['Input']">
    <ValInput v-if="show" />
    <div v-else>没有组件</div>
  </KeepAlive>
</template>
<script lang="ts" setup>
const show = ref(false);
onActivated(() => {
  console.log("onActivated");
});
definePageMeta({
  keepalive: true,
});
</script>
<style>
.links a {
  padding: 20px;
}
</style>
